Class TopicSubscriber


  • public class TopicSubscriber
    extends java.lang.Object
    A3L Topic subscription and unsubscription handler class.
    • Constructor Summary

      Constructors 
      Constructor Description
      TopicSubscriber()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.google.android.gms.tasks.Task<java.lang.Void> subscribeToTopic​(android.content.Context context, java.lang.String currentPlatform, java.lang.String topic)
      Method which starts the subscribing the deviceToken to a topic with the help of platform libraries in a separate thread.
      com.google.android.gms.tasks.Task<java.lang.Void> unsubscribeFromTopic​(android.content.Context context, java.lang.String currentPlatform, java.lang.String topic)
      Method which starts the unsubscribing the deviceToken from a topic with the help of platform libraries in a separate thread.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TopicSubscriber

        public TopicSubscriber()
    • Method Detail

      • subscribeToTopic

        public com.google.android.gms.tasks.Task<java.lang.Void> subscribeToTopic​(@NonNull
                                                                                  android.content.Context context,
                                                                                  @NonNull
                                                                                  java.lang.String currentPlatform,
                                                                                  @NonNull
                                                                                  java.lang.String topic)
        Method which starts the subscribing the deviceToken to a topic with the help of platform libraries in a separate thread.
        Parameters:
        context - Application Context.
        currentPlatform - Messaging platform present in the device.
        topic - Topic to which the app instance is to be subscribed.
        Returns:
        Task which can be used by completion listener to determine whether the subscription completed.
      • unsubscribeFromTopic

        public com.google.android.gms.tasks.Task<java.lang.Void> unsubscribeFromTopic​(@NonNull
                                                                                      android.content.Context context,
                                                                                      @NonNull
                                                                                      java.lang.String currentPlatform,
                                                                                      @NonNull
                                                                                      java.lang.String topic)
        Method which starts the unsubscribing the deviceToken from a topic with the help of platform libraries in a separate thread.
        Parameters:
        context - : Application Context.
        currentPlatform - : Messaging platform present in the device.
        topic - : Topic to which the app instance is to be subscribed.
        Returns:
        Task which can be used by completion listener to determine whether the unsubscription completed.